$(function() {
	new Vue({
		el: '#addCouponTypeApp',
		data: {
			fullscreenLoading: false,
			form: {
				name: "",
			}
		},
		methods: {
			configManagerSuper() {
				if (stringEmpty(this.form.name)) {
					this.$message.error('优惠券名称不能为空');
					return
				}
				let upForm = {}
				upForm.name = this.form.name
				this.fullscreenLoading = true;
				axios({
					url: POSTURL.addCouponsTemplate,
					method: 'post',
					data: upForm
				}).then(response => {
					this.fullscreenLoading = false;
					if (response.data.code === 100) {
						this.$message({
							showClose: true,
							message: response.data.message,
							type: 'success'
						});
						this.form = {};
					} else {
						this.$message.error(response.data.message);
					}
				}).catch(error => {
					this.fullscreenLoading = false;
					console.log(error);
					this.$message.error('服务器出错!');
				})
			},
		}
	})
})
